package com.nbsaas.boot.store.rest.convert;

import com.nbsaas.boot.store.data.entity.StorePay;
import com.nbsaas.boot.store.api.domain.simple.StorePaySimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class StorePaySimpleConvert implements Converter<StorePaySimple, StorePay> {




@Override
public StorePaySimple convert(StorePay source) {
    StorePaySimple result = new StorePaySimple();

                result.setPayMoney(source.getPayMoney());
                result.setOriginalPrice(source.getOriginalPrice());
                result.setDeduction(source.getDeduction());
                if(source.getStore()!=null){
                    result.setStoreName(source.getStore().getName());
                }
                if(source.getStore()!=null){
                    result.setStore(source.getStore().getId());
                }
                result.setId(source.getId());
                result.setBackMoney(source.getBackMoney());
                result.setAddDate(source.getAddDate());
                if(source.getCustomer()!=null){
                    result.setCustomerName(source.getCustomer().getName());
                }
                if(source.getCustomer()!=null){
                    result.setCustomer(source.getCustomer().getId());
                }
                result.setLastDate(source.getLastDate());


    return result;
}

}